Fix file descriptor leaks on arm Android
authorPo Lu <luangruo@yahoo.com>
Sun, 13 Apr 2025 11:02:00 +0000 (19:02 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 13 Apr 2025 11:02:04 +0000 (19:02 +0800)
* exec/loader-aarch64.s (_start):

* exec/loader-armeabi.s (_start): Fix thinko.
Do not merge to master.

exec/loader-aarch64.s
exec/loader-armeabi.s

index 686a804aa0edc5b0385a14d6380b98bc7f189799..a04e4362ef0c1d87aa17bf94d7f0671d45b5d535 100644 (file)
@@ -168,7 +168,7 @@ _start:
        b       .one_auxv
 .cleanup:
        cmp     x28, #-1                // is secondary fd set?
-       bne     .cleanup1               // not set
+       beq     .cleanup1               // not set
        mov     x8, #57                 // SYS_close
        mov     x0, x28                 // secondary fd
        svc     #0                      // syscall
index 2aa52f3e006d8bdba1a1787a498458e87ddb02ef..e0aabdbe734b4d3a79918ada3985e4df2e7b4bfb 100644 (file)
@@ -181,7 +181,7 @@ _start:
        b       .one_auxv
 .cleanup:
        cmp     r14, #-1                @ secondary fd set?
-       bne     .cleanup1               @ not set
+       beq     .cleanup1               @ not set
        mov     r7, #6                  @ SYS_close
        mov     r0, r14                 @ secondary fd
        swi     #0                      @ syscall